<template>
  <div class="owner">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="line-height: 36px;">货主管理</span>
        <el-button style="float: right;" type="primary" @click="dialogOpen()" v-if="USER.auth.indexOf('business_owner_add')!==-1">新增货主</el-button>
      </div>
      <s-table
        :table="table"
        @http="tableWatch">
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="150">
          <template scope="s">
            <el-button type="info"  size="mini" @click="dialogLibraryOpen(s.row)" v-if="USER.auth.indexOf('business_owner_edit_kuwei')!==-1">查看</el-button>
            <el-button type="success"  size="mini" @click="dialogEditOpen(s.row)" v-if="USER.auth.indexOf('business_owner_edit_jichu')!==-1">编辑</el-button>
            <el-button type="info" size="mini" @click="dialogOrderTypeOpen(s.row)" v-if="USER.auth.indexOf('business_owner_edit_dingdan')!==-1">配置订单</el-button>
            <el-button type="warning" size="mini" @click="dialogStepLibraryOpen(s.row)" v-if="USER.auth.indexOf('business_owner_edit_jihuo')!==-1">集货暂存</el-button>
            <!--<el-tooltip placement="top">-->
              <!--<div slot="content">更多可用操作</div>-->
              <!--<el-popover-->
                <!--popper-class="demo-table-expand"-->
                <!--placement="right"-->
                <!--title="更多可用操作"-->
                <!--trigger="click">-->
                <!--<slot name="content">-->
                 <!---->
                <!--</slot>-->
                <!--<el-button slot="reference" type="info" icon="more" :plain="true" size="mini" class="__reference"></el-button>-->
              <!--</el-popover>-->
            <!--</el-tooltip>-->
          </template>
        </el-table-column>
        <el-row>
          <el-col :xs="24" :lg="{span: 4, offset: 0}">
            <el-form-item label="货主名称" prop="mc">
              <el-input type="text"
                        class="input"
                        v-model="autoVue_table_mc"
                        placeholder="货主名称" spellcheck="false" auto-capitalize="off" auto-complete="off"
                        auto-correct="off"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-table>
    </el-card>

    <s-dialog :dialog="dialog" :close="dialogInit">
      <p slot="title">{{dialog.title}}货主</p>
      <el-tabs v-model="dialog.activeName">
        <el-tab-pane label="基础设置" name="1" disabled>
          <s-form :form="formDialog1" ref="formDialog1">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="mc" label="货主名称">
                  <el-input
                    type="text"
                    v-model="formDialog1.mc"
                    placeholder="货主名称"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="yxj" label="优先级">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog1.yxj"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog1.yxj" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.yxj"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="lxr" label="联系人">
                  <el-input
                    type="text"
                    v-model="formDialog1.lxr"
                    placeholder="联系人"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="dz" label="地址">
                  <el-input
                    type="text"
                    v-model="formDialog1.dz"
                    placeholder="地址"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="指定库位" name="2" disabled>
          <el-tree
            :data="dialog.tree"
            ref="tree"
            node-key="key"
            show-checkbox>
          </el-tree>
        </el-tab-pane>
        <el-tab-pane label="规则设置" name="3" disabled>
          <s-form :form="formDialog3" ref="formDialog3">
            <el-form-item prop="sjgzid" label="上架规则">
              <el-select v-model="formDialog3.sjgzid"
                         filterable
                         placeholder="请选择上架规则">
                <el-option
                  v-for="item in dialog.wmsShelfRule"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="zzgzIds" label="周转规则">
              <el-select v-model="formDialog3.zzgzIds"
                         filterable
                         multiple
                         placeholder="请选择周转规则">
                <el-option
                  v-for="item in dialog.wmsTurnOverRule"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="订单设置" name="4" disabled>
          <s-form :form="formDialog4" ref="formDialog4">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="slbuck" label="出库规则">
                  <el-select v-model="formDialog4.slbuck" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.slbuck"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="ddsxts" label="订单失效天">
                  <el-input
                    type="text"
                    v-model="formDialog4.ddsxts"
                    placeholder="订单失效天"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="dcfh" label="多次发货">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog4.dcfh"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog4.dcfh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.dcfh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="zyzdqr" label="库内转移">
                  <el-select v-model="formDialog4.zyzdqr" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.zyzdqr"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="bhzdqr" label="补货单">
                  <el-select v-model="formDialog4.bhzdqr" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.bhzdqr"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="更多设置" name="5" disabled>
          <s-form :form="formDialog5" ref="formDialog5">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="zjfs" label="质检方式">
                  <el-select v-model="formDialog5.zjfs" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.zjfs"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="kcyj" label="库存预警">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.kcyj"
                      on-color="#13ce66"
                      on-text="启用"
                      off-text="不启"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--
                  <el-select v-model="formDialog5.kcyj" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.kcyj"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                  -->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="djdps" label="DPS">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.djdps"
                      on-color="#13ce66"
                      on-text="对接"
                      off-text="不接"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.djdps" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.djdps"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="djpda" label="PDA">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.djpda"
                      on-color="#13ce66"
                      on-text="对接"
                      off-text="不接"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.djpda" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.djpda"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="zxqx" label="是否装箱">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.zxqx"
                      on-color="#13ce66"
                      on-text="装箱"
                      off-text="不装"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.zxqx" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.zxgx"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="sfbh" label="是否补货">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.sfbh"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.sfbh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.sfbh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="pdwwcqx" label="完成盘点">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.pdwwcqx"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.pdwwcqx" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.pdwwcqx"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="ckfh" label="出库复核">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.ckfh"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.ckfh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.ckfh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="cz" label="称重">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.cz"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.cz" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.cz"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="fhdymd" label="复核时打印快递面单">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.fhdymd"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.fhdymd" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.fhdymd"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="zcd" label="装车单">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.zcd"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.zcd" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.zcd"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="cmhpm" label="扫描货品码">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.cmhpm"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.cmhpm" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.cmhpm"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="smLpn" label="扫描LPN">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialog5.smLpn"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialog5.smLpn" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.smLpn"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
      </el-tabs>
      <el-button slot="footer" v-if="dialog.activeName !== '1'" @click="dialogPre">上一页</el-button>
      <el-button slot="footer" type="info" v-if="dialog.activeName !== '5'" @click="dialogNext">下一页</el-button>
      <el-button slot="footer" type="success" v-if="dialog.activeName === '5'" @click="dialogSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogEdit" :close="dialogEditInit">
      <p slot="title">{{dialogEdit.title}}货主</p>
      <el-tabs v-model="dialogEdit.activeName">
        <el-tab-pane label="基础设置" name="1" disabled>
          <s-form :form="formDialogEdit1" ref="formDialogEdit1">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="mc" label="货主名称">
                  <el-input
                    type="text"
                    v-model="formDialogEdit1.mc"
                    placeholder="货主名称"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="yxj" label="优先级">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit1.yxj"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit1.yxj" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.yxj"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="lxr" label="联系人">
                  <el-input
                    type="text"
                    v-model="formDialogEdit1.lxr"
                    placeholder="联系人"></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="dz" label="地址">
                  <el-input
                    type="text"
                    v-model="formDialogEdit1.dz"
                    placeholder="地址"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="规则设置" name="2" disabled>
          <s-form :form="formDialogEdit2" ref="formDialogEdit2">
            <el-form-item prop="sjgzid" label="上架规则">
              <el-select v-model="formDialogEdit2.sjgzid"
                         filterable
                         placeholder="请选择上架规则">
                <el-option
                  v-for="item in dialog.wmsShelfRule"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="zzgzIds" label="周转规则">
              <el-select v-model="formDialogEdit2.zzgzIds"
                         filterable
                         multiple
                         placeholder="请选择周转规则">
                <el-option
                  v-for="item in dialog.wmsTurnOverRule"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="订单设置" name="3" disabled>
          <s-form :form="formDialogEdit3" ref="formDialogEdit3">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="slbuck" label="出库规则">
                  <el-select v-model="formDialogEdit3.slbuck" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.slbuck"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="ddsxts" label="订单失效天">
                  <el-input
                    type="text"
                    v-model="formDialogEdit3.ddsxts"
                    placeholder="订单失效天"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="dcfh" label="多次发货">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit3.dcfh"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit3.dcfh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.dcfh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="zyzdqr" label="库内转移">
                  <el-select v-model="formDialogEdit3.zyzdqr" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.zyzdqr"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="bhzdqr" label="补货单">
                  <el-select v-model="formDialogEdit3.bhzdqr" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.bhzdqr"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
        <el-tab-pane label="更多设置" name="4" disabled>
          <s-form :form="formDialogEdit4" ref="formDialogEdit4">
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="zjfs" label="质检方式">
                  <el-select v-model="formDialogEdit4.zjfs" placeholder="请选择">
                    <el-option
                      v-for="item in HUOZHU.zjfs"
                      :key="item.dictionaryid"
                      :label="item.value"
                      :value="item.dictionaryid">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="kcyj" label="库存预警">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.kcyj"
                      on-color="#13ce66"
                      on-text="启用"
                      off-text="不启"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.kcyj" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.kcyj"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="djdps" label="DPS">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.djdps"
                      on-color="#13ce66"
                      on-text="对接"
                      off-text="不接"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.djdps" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.djdps"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}">
                <el-form-item prop="djpda" label="PDA">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.djpda"
                      on-color="#13ce66"
                      on-text="对接"
                      off-text="不接"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.djpda" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.djpda"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="zxqx" label="是否装箱">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.zxqx"
                      on-color="#13ce66"
                      on-text="装箱"
                      off-text="不装"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.zxqx" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.zxgx"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="sfbh" label="是否补货">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.sfbh"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.sfbh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.sfbh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}">
                <el-form-item prop="pdwwcqx" label="完成盘点">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.pdwwcqx"
                      on-color="#13ce66"
                      on-text="允许"
                      off-text="不许"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.pdwwcqx" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.pdwwcqx"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="ckfh" label="出库复核">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.ckfh"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.ckfh" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.ckfh"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="cz" label="称重">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.cz"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.cz" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.cz"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="fhdymd" label="复核时打印快递面单">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.fhdymd"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.fhdymd" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.fhdymd"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="zcd" label="装车单">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.zcd"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.zcd" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.zcd"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
              <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
                <el-form-item prop="cmhpm" label="扫描货品码">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.cmhpm"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.cmhpm" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.cmhpm"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
                <el-form-item prop="smLpn" label="扫描LPN">
                  <div class="s-content">
                    <el-switch
                      v-model="formDialogEdit4.smLpn"
                      on-color="#13ce66"
                      on-text="是"
                      off-text="否"
                      off-color="#ff4949"
                      on-value="1"
                      off-value="0">
                    </el-switch>
                  </div>
                  <!--<el-select v-model="formDialogEdit4.smLpn" placeholder="请选择">-->
                    <!--<el-option-->
                      <!--v-for="item in HUOZHU.smLpn"-->
                      <!--:key="item.dictionaryid"-->
                      <!--:label="item.value"-->
                      <!--:value="item.dictionaryid">-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                </el-form-item>
              </el-col>
            </el-row>
          </s-form>
        </el-tab-pane>
      </el-tabs>

      <el-button slot="footer" v-if="dialogEdit.activeName !== '1'" @click="dialogEditPre">上一页</el-button>
      <el-button slot="footer" type="info" v-if="dialogEdit.activeName !== '4'" @click="dialogEditNext">下一页</el-button>
      <el-button slot="footer" type="success" v-if="dialogEdit.activeName === '4'" @click="dialogEditSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogLibrary" :close="dialogLibraryInit">
      <p slot="title">货主拥有库位 <span>{{dialogLibrary.row.mc}}</span></p>
      <el-tree
        :data="dialogLibrary.tree.data"
        :ref="dialogLibrary.tree.ref"
        node-key="key"
        :default-checked-keys="dialogLibrary.tree.ids"
        show-checkbox>
      </el-tree>
      <el-button slot="footer" type="success" @click="dialogLibrarySave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogOrderType" :close="dialogOrderTypeInit">
      <p slot="title">订单类型 <span>{{dialogOrderType.row.mc}}</span></p>
      <s-table
        :multiSelect="true"
        :table="tableOrderType"
        ref="tableOrderType"
        @http="tableWatch">
        <el-form-item label="订单类型" prop="ddlx">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableOrderType_ddlx"
                    placeholder="订单类型" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
        <el-form-item label="订单分类" prop="fl">
          <el-select v-model="autoVue_tableOrderType_fl"
                     placeholder="订单分类">
            <el-option
              label="全部"
              value=""></el-option>
            <el-option
              label="入库单"
              value="0"></el-option>
            <el-option
              label="出库单"
              value="1"></el-option>
          </el-select>
        </el-form-item>
      </s-table>
      <el-button slot="footer" type="success" @click="dialogOrderTypeSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogStepLibrary" :close="dialogStepLibraryInit">
      <p slot="title">配置集货库位和暂存库位<span>{{dialogStepLibrary.row.mc}}</span></p>
      <s-form :form="formDialogStepLibrary" ref="formDialogStepLibrary">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="jhqkwMc" label="集货库位">
              <el-input
                type="text"
                v-model="formDialogStepLibrary.jhqkwMc"
                placeholder="标题行号"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="djcwMc" label="暂存库位">
              <el-input
                type="text"
                v-model="formDialogStepLibrary.djcwMc"
                placeholder="取值行号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" type="success" @click="dialogStepLibrarySave">保存</el-button>
    </s-dialog>
  </div>
</template>

<script>
  import {AutoVue, AutoPromise} from '~/plugins/Tools';

  function __form1 () {
    return {
      mc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      lxr: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      dz: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      yxj: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
    };
  }
  function __form3 () {
    return {
      sjgzid: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      zzgzIds: { value: [], rule: [ 'vNull' ], cRemarks: '' },
    };
  }
  function __form4 () {
    return {
      slbuck: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
      dcfh: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
      zyzdqr: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      bhzdqr: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      ddsxts: { value: '', rule: [ 'vNull', 'vNumberZ', 'vWS4' ], cRemarks: '' },
    };
  }
  function __form5 () {
    return {
      shfk: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      shzdmp: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
      shscpch: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      shscscrq: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      kcyj: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      pdwwcqx: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      djpda: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
      sfbh: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
      zjfs: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
      zxqx: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
      djdps: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      ckfh: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      cz: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      fhdymd: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      zcd: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      cmhpm: { value: '0', rule: ['vNull__change'], cRemarks: '' },
      smLpn: { value: '0', rule: ['vNull__change'], cRemarks: '' },
    };
  }
  function __formDialogStepLibrary () {
    return {
      jhqkwMc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      djcwMc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
    };
  }
  function __formEdit (number) {
    switch (number) {
    case 1:
      return {
        mc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
        lxr: { value: '', rule: [ 'vNull' ], cRemarks: '' },
        dz: { value: '', rule: [ 'vNull' ], cRemarks: '' },
        yxj: { value: '0', rule: [ 'vNull__change' ], cRemarks: '' },
      };
    case 2:
      return {
        sjgzid: { value: '', rule: [ 'vNull' ], cRemarks: '' },
        zzgzIds: { value: [], rule: [ 'vNull' ], cRemarks: '' },
      };
    case 3:
      return {
        slbuck: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
        dcfh: { value: '1', rule: [ 'vNull' ], cRemarks: '' },
        zyzdqr: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
        bhzdqr: { value: '0', rule: [ 'vNull' ], cRemarks: '' },
        ddsxts: { value: '', rule: [ 'vNull', 'vNumberZ', 'vWS4' ], cRemarks: '' },
      };
    case 4:
      return __form5();
    }
  }
  export default AutoVue({
    name: 'business_owner-FEcarWms',
    head: {
      'title': '货主管理',
      'meta': [
        { 'hid': 'description', 'name': 'description', 'content': '乐速科技平台 货主 查看货主信息' },
      ],
    },
    data: {
      table: {
        column: [ { label: '货主名称',
          prop: 'mc',
          minWidth: '0px',
          cRemarks: '',
          search: true },
        { label: '联系人',
          prop: 'lxr',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '地址',
          prop: 'dz',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '上架规则',
          prop: 'show_sjgzid',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '周转规则',
          prop: 'show_zzgzIds',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '出库规则',
          prop: 'show_slbuck',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '多次发货',
          prop: 'show_dcfh',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '库内转移',
          prop: 'show_zyzdqr',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '补货单',
          prop: 'show_bhzdqr',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '失效天数',
          prop: 'ddsxts',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '收货反馈',
          prop: 'show_shfk',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '自动码盘',
          prop: 'show_shzdmp',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '批次号',
          prop: 'show_shscpch',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '是否装箱',
          prop: 'show_zxqx',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '生产日期',
          prop: 'show_shscscrq',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '库存预警',
          prop: 'show_kcyj',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '完成盘点',
          prop: 'show_pdwwcqx',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: 'PDA',
          prop: 'show_djpda',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: 'DPS',
          prop: 'show_djdps',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '出库复核',
          prop: 'show_ckfh',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '称重',
          prop: 'show_cz',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '快递面单',
          prop: 'show_fhdymd',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '装车单',
          prop: 'show_zcd',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '扫描货品码',
          prop: 'show_cmhpm',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '扫描LPN',
          prop: 'show_smLpn',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        ],
        url: '/wmsOwner/list',
        key: 'id',
        tableColumn: 3,
        muti: false,
      },
      formDialog1: __form1(),
      formDialog3: __form3(),
      formDialog4: __form4(),
      formDialog5: __form5(),
      dialog: {
        title: '新增',
        size: 'large',
        tree: [],
        wmsShelfRule: [],
        wmsTurnOverRule: [],
        activeName: '1',
      },
      dialogEdit: {
        title: '修改',
        size: 'large',
        row: {},
        activeName: '1',
      },
      formDialogEdit1: __formEdit(1),
      formDialogEdit2: __formEdit(2),
      formDialogEdit3: __formEdit(3),
      formDialogEdit4: __formEdit(4),
      dialogLibrary: {
        row: {},
        tree: {
          ref: 'libraryTree',
          data: [],
          ids: [],
        },
      },
      dialogOrderType: {
        row: {},
      },
      dialogStepLibrary: {
        row: {},
      },
      formDialogStepLibrary: __formDialogStepLibrary(),
      tableOrderType: {
        column: [
          { label: '货主名称',
            prop: 'mc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '订单类型',
            prop: 'ddlx',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '订单分类',
            prop: 'show_fl',
            minWidth: '0px',
            cRemarks: '0入库单 1出库单',
            search: true },
          { label: '是否采集SN码',
            prop: 'show_cjsn',
            minWidth: '0px',
            cRemarks: '0不采集 1采集',
            search: false },
        ],
        baseUrl: '/wmsOwner/getOrderTypeByHzId/',
        url: '/',
        key: 'id',
        tableColumn: 3,
        muti: false,
      },
    },
    transition: 'slide-fade',
    store: ['HUOZHU', 'USER', 'DICTIONARY_huozhu'],
    methods: {
      dialogInit () {
        this.dialog.activeName = '1';
        this.formDialog1 = {
          ...this.formDialog1,
          ...this.ObjectClone(__form1()),
        };
        this.formDialog3 = {
          ...this.formDialog3,
          ...this.ObjectClone(__form3()),
        };
        this.formDialog4 = {
          ...this.formDialog4,
          ...this.ObjectClone(__form4()),
        };
        this.formDialog5 = {
          ...this.formDialog5,
          ...this.ObjectClone(__form5()),
        };
        this.resetFields('formDialog1');
        this.resetFields('formDialog3');
        this.resetFields('formDialog4');
        this.resetFields('formDialog5');
      },
      async dialogOpen () {
        await AutoPromise([
          async () => {
            if (!this.DICTIONARY_huozhu) {
              await this.USE('DICTIONARY_huozhu');
            }
          },
          async () => {
            this.dialog.tree = await this.get('/wmsOwner/getLibraryareaTree');
          },
          async () => {
            if (this.dialog.wmsShelfRule.length === 0) {
              this.dialog.wmsShelfRule = await this.get('/wmsShelfRule/getDictionary');
            }
          },
          async () => {
            if (this.dialog.wmsTurnOverRule.length === 0) {
              this.dialog.wmsTurnOverRule = await this.get('/wmsTurnOverRule/getDictionary');
            }
          },
        ]);
        this.dialog.visible = true;
      },
      dialogSave () {
        this.VALIDATE('formDialog5', async option => {
          let tree = this.$refs.tree;
          let ids = tree.getCheckedKeys(true);
          let idsParent = [];
          let addIdsParent = key => {
            let parent = tree.store.nodesMap[key].parent;
            if (typeof parent.key === 'undefined' || idsParent.indexOf(parent.key) !== -1) return;
            idsParent.push(parent.key);
            addIdsParent(parent.key);
          };
          for (let item of ids) {
            addIdsParent(item);
          }
          ids = [...ids, ...idsParent];
          option.librarypositionIds = ids;
          let zzgzIds = '';
          this.formDialog3.zzgzIds.forEach(value => {
            zzgzIds += value + ',';
          });
          zzgzIds = zzgzIds.substring(0, zzgzIds.length - 1);
          let json = {
            ...this.FORMOPTION('formDialog1'),
            ...this.FORMOPTION('formDialog3'),
            ...this.FORMOPTION('formDialog4'),
            ...this.FORMOPTION('formDialog5'),
            ...this.FORMOPTION('formDialog6'),
            ...option,
            zzgzIds,
          };
          try {
            let {data} = await this.post('/wmsOwner/add', json);
            this.table.data = [await this.get('/wmsOwner/getWmsOwnerById/' + data.id), ...this.table.data];
            this.table.total++;
            this.dialogInit();
            this.dialogStepLibraryOpen(data);
            this.dialog.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
      dialogPre () {
        this.dialog.activeName = parseInt(this.dialog.activeName) - 1 + '';
      },
      dialogNext () {
        if (this.dialog.activeName === '2') {
          let ids = this.$refs.tree.getCheckedKeys(true);
          if (ids.length < 1) {
            this.$alert('请至少选择一个库位！', '提示');
          } else {
            this.dialog.activeName = parseInt(this.dialog.activeName) + 1 + '';
          }
        } else {
          this.VALIDATE('formDialog' + this.dialog.activeName, option => {
            this.dialog.activeName = parseInt(this.dialog.activeName) + 1 + '';
          });
        }
      },
      dialogEditInit () {
        this.dialogEdit.row = {};
        this.dialogEdit.activeName = '1';
        this.formDialogEdit1 = {
          ...this.formDialogEdit1,
          ...this.ObjectClone(__formEdit(1)),
        };
        this.formDialogEdit2 = {
          ...this.formDialogEdit2,
          ...this.ObjectClone(__formEdit(2)),
        };
        this.formDialogEdit3 = {
          ...this.formDialogEdit3,
          ...this.ObjectClone(__formEdit(3)),
        };
        this.formDialogEdit4 = {
          ...this.formDialogEdit4,
          ...this.ObjectClone(__formEdit(4)),
        };
        this.formDialogEdit5 = {
          ...this.formDialogEdit5,
          ...this.ObjectClone(__formEdit(5)),
        };
        this.resetFields('formDialogEdit1');
        this.resetFields('formDialogEdit2');
        this.resetFields('formDialogEdit3');
        this.resetFields('formDialogEdit4');
        this.resetFields('formDialogEdit5');
      },
      async dialogEditOpen (row) {
        let {contentList} = await this.get('/wmsOwner/getZzgzByHzid/' + row.id);
        row.zzgzIds = contentList;
        await AutoPromise([
          async () => {
            if (!this.DICTIONARY_huozhu) {
              await this.USE('DICTIONARY_huozhu');
            }
          },
          async () => {
            if (this.dialog.wmsShelfRule.length === 0) {
              this.dialog.wmsShelfRule = await this.get('/wmsShelfRule/getDictionary');
            }
          },
          async () => {
            if (this.dialog.wmsTurnOverRule.length === 0) {
              this.dialog.wmsTurnOverRule = await this.get('/wmsTurnOverRule/getDictionary');
            }
          },
        ]);
        for (let i = 1; i <= 4; i++) {
          this['formDialogEdit' + i] = {
            ...this['formDialogEdit' + i],
            ...this.ObjectClone(__formEdit(i), row),
          };
        }
        this.dialogEdit.row = row;
        this.dialogEdit.visible = true;
      },
      dialogEditSave () {
        this.VALIDATE('formDialogEdit4', async option => {
          try {
            let step = {
              ...this.dialogEdit.row,
              ...this.FORMOPTION('formDialogEdit1'),
              ...this.FORMOPTION('formDialogEdit2'),
              ...this.FORMOPTION('formDialogEdit3'),
              ...this.FORMOPTION('formDialogEdit4'),
              ...option,
            };
            delete step.gxsj;
            let ids = '';
            for (let item of step.zzgzIds) {
              ids += item + ',';
            }
            step.zzgzIds = ids.substring(0, ids.length - 1);
            await this.post('/wmsOwner/edit', step);
            this.tableWatch('table');
            this.dialogEditInit();
            this.dialogEdit.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
      dialogEditPre () {
        this.dialogEdit.activeName = parseInt(this.dialogEdit.activeName) - 1 + '';
      },
      dialogEditNext () {
        this.VALIDATE('formDialogEdit' + this.dialogEdit.activeName, option => {
          this.dialogEdit.activeName = parseInt(this.dialogEdit.activeName) + 1 + '';
        });
      },
      dialogLibraryInit () {
        this.dialogLibrary.row = {};
        this.dialogLibrary.tree.data = [];
        this.dialogLibrary.tree.ids = [];
        this.$refs[this.dialogLibrary.tree.ref].setCheckedKeys([]);
      },
      async dialogLibraryOpen (row) {
        let {data, ids} = await this.get('/wmsOwner/selectPostionBySshzidOrFree/' + row.id);
        this.dialogLibrary.row = row;
        this.dialogLibrary.visible = true;
        let _this = this;
        this.$nextTick(function () {
          _this.dialogLibrary.tree.data = data;
          _this.$refs[this.dialogLibrary.tree.ref].setCheckedKeys(ids);
        });
      },
      async dialogLibrarySave () {
        try {
          await this.post('/wmsOwner/editLibraryposition', {
            ids: this.$refs[this.dialogLibrary.tree.ref].getCheckedKeys(true),
            sshzid: this.dialogLibrary.row.id,
          });
          this.dialogLibrary.visible = false;
        } catch (err) {
          console.error(err);
        }
      },
      dialogOrderTypeInit () {
        this.dialogOrderType.row = {};
        this.tableOrderType.ids = [];
        this.$refs.tableOrderType.$refs.tableOrderType.clearSelection();
      },
      async dialogOrderTypeOpen (row) {
        this.tableOrderType.url = this.tableOrderType.baseUrl + row.id;
        this.dialogOrderType.row = row;
        this.tableOrderType.ids = await this.get('/wmsOwner/getOrderTypeIds/' + row.id);
        this.tableWatch('tableOrderType');
        this.dialogOrderType.visible = true;
      },
      async dialogOrderTypeSave () {
        await this.post('/wmsOwner/editOrderType', {
          ids: this.tableIds('tableOrderType'),
          sshzid: this.dialogOrderType.row.id,
        });
        this.dialogOrderTypeInit();
        this.dialogOrderType.visible = false;
      },
      dialogStepLibraryInit () {
        this.dialogStepLibrary.row = {};
        this.formDialogStepLibrary = {
          ...this.formDialogStepLibrary,
          ...this.ObjectClone(__formDialogStepLibrary()),
        };
        this.resetFields('formDialogStepLibrary');
      },
      async dialogStepLibraryOpen (row) {
        let {jhqkwMc, djcwMc} = await this.get('/wmsOwner/getAllKw/' + row.id);
        this.formDialogStepLibrary.jhqkwMc = jhqkwMc;
        this.formDialogStepLibrary.djcwMc = djcwMc;
        this.dialogStepLibrary.row = row;
        this.dialogStepLibrary.visible = true;
      },
      dialogStepLibrarySave () {
        this.VALIDATE('formDialogStepLibrary', async option => {
          await this.post('/wmsOwner/addAllKw/' + this.dialogStepLibrary.row.id, option);
          this.dialogStepLibraryInit();
          this.dialogStepLibrary.visible = false;
        });
      },
    },
    mounted: function () {
      this.tableWatch('table');
      console.log(this);
    },
  });
</script>
<style scoped lang="scss">
  .box-card {
    margin: 20px;
  }

  .createTimeSpan {
    display: block;
    margin-top: 34px;
  }

  @media screen and (max-width: 800px) {
    .createTimeSpan {
      margin-top: 0;
    }
    .box-card {
      margin: 0;
    }
  }

  .el-select {
    width: 100%;
  }
</style>

<style lang="scss">
  .owner{
    width: 88vw;
    float: left;
  }
</style>
